package com.bluestone.config;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;
/**
 * @author <a href="mailto:ming7655@gmail.com">Aaron</a>
 *
 * 
 */

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "controller" , propOrder = {
		"listeners"
	})
public class ControllerConfig extends AbstractConfig {
	@XmlAttribute
	private String name;
	
	@XmlElementWrapper(name = "listeners")
	@XmlElement(name = "listeners")
	private List<ListenerConfig> listeners;
	
	public void putListenerConfig(ListenerConfig lc){
		if(listeners==null){
			listeners = new ArrayList();
		}
		listeners.add(lc);
	}
	public List<ListenerConfig> getListeners() {
		return listeners;
	}

	public void setListeners(List<ListenerConfig> listeners) {
		this.listeners = listeners;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
